/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Held_Plots;
import com.crossriver.crgis.database.model.Held_PlotsModel;
import com.crossriver.crgis.database.model.Held_PlotsSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.List;

/**
 * The base model implementation for the Held_Plots service. Represents a row in the &quot;CRGIA_Held_Plots&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Held_PlotsModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Held_PlotsImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a held_ plots model instance should use the {@link com.crossriver.crgis.database.model.Held_Plots} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Held_PlotsImpl
 * @see com.crossriver.crgis.database.model.Held_Plots
 * @see com.crossriver.crgis.database.model.Held_PlotsModel
 * @generated
 */
public class Held_PlotsModelImpl extends BaseModelImpl<Held_Plots>
	implements Held_PlotsModel {
	public static final String TABLE_NAME = "CRGIA_Held_Plots";
	public static final Object[][] TABLE_COLUMNS = {
			{ "held_id", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "location", new Integer(Types.VARCHAR) },
			{ "area", new Integer(Types.VARCHAR) },
			{ "developed", new Integer(Types.VARCHAR) },
			{ "acquisitionMode", new Integer(Types.VARCHAR) },
			{ "regParticulars", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Held_Plots (held_id VARCHAR(75) not null primary key,userId VARCHAR(75) null,applicationId VARCHAR(75) null,location VARCHAR(75) null,area VARCHAR(75) null,developed VARCHAR(75) null,acquisitionMode VARCHAR(75) null,regParticulars VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Held_Plots";
	public static final String ORDER_BY_JPQL = " ORDER BY held_Plots.held_id ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Held_Plots.held_id ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Held_Plots"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Held_Plots"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Held_Plots toModel(Held_PlotsSoap soapModel) {
		Held_Plots model = new Held_PlotsImpl();

		model.setHeld_id(soapModel.getHeld_id());
		model.setUserId(soapModel.getUserId());
		model.setApplicationId(soapModel.getApplicationId());
		model.setLocation(soapModel.getLocation());
		model.setArea(soapModel.getArea());
		model.setDeveloped(soapModel.getDeveloped());
		model.setAcquisitionMode(soapModel.getAcquisitionMode());
		model.setRegParticulars(soapModel.getRegParticulars());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Held_Plots> toModels(Held_PlotsSoap[] soapModels) {
		List<Held_Plots> models = new ArrayList<Held_Plots>(soapModels.length);

		for (Held_PlotsSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Held_Plots"));

	public Held_PlotsModelImpl() {
	}

	public String getPrimaryKey() {
		return _held_id;
	}

	public void setPrimaryKey(String pk) {
		setHeld_id(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _held_id;
	}

	public String getHeld_id() {
		if (_held_id == null) {
			return StringPool.BLANK;
		}
		else {
			return _held_id;
		}
	}

	public void setHeld_id(String held_id) {
		_held_id = held_id;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getLocation() {
		if (_location == null) {
			return StringPool.BLANK;
		}
		else {
			return _location;
		}
	}

	public void setLocation(String location) {
		_location = location;
	}

	public String getArea() {
		if (_area == null) {
			return StringPool.BLANK;
		}
		else {
			return _area;
		}
	}

	public void setArea(String area) {
		_area = area;
	}

	public String getDeveloped() {
		if (_developed == null) {
			return StringPool.BLANK;
		}
		else {
			return _developed;
		}
	}

	public void setDeveloped(String developed) {
		_developed = developed;
	}

	public String getAcquisitionMode() {
		if (_acquisitionMode == null) {
			return StringPool.BLANK;
		}
		else {
			return _acquisitionMode;
		}
	}

	public void setAcquisitionMode(String acquisitionMode) {
		_acquisitionMode = acquisitionMode;
	}

	public String getRegParticulars() {
		if (_regParticulars == null) {
			return StringPool.BLANK;
		}
		else {
			return _regParticulars;
		}
	}

	public void setRegParticulars(String regParticulars) {
		_regParticulars = regParticulars;
	}

	public Held_Plots toEscapedModel() {
		if (isEscapedModel()) {
			return (Held_Plots)this;
		}
		else {
			return (Held_Plots)Proxy.newProxyInstance(Held_Plots.class.getClassLoader(),
				new Class[] { Held_Plots.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Held_PlotsImpl held_PlotsImpl = new Held_PlotsImpl();

		held_PlotsImpl.setHeld_id(getHeld_id());

		held_PlotsImpl.setUserId(getUserId());

		held_PlotsImpl.setApplicationId(getApplicationId());

		held_PlotsImpl.setLocation(getLocation());

		held_PlotsImpl.setArea(getArea());

		held_PlotsImpl.setDeveloped(getDeveloped());

		held_PlotsImpl.setAcquisitionMode(getAcquisitionMode());

		held_PlotsImpl.setRegParticulars(getRegParticulars());

		return held_PlotsImpl;
	}

	public int compareTo(Held_Plots held_Plots) {
		int value = 0;

		value = getHeld_id().compareTo(held_Plots.getHeld_id());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Held_Plots held_Plots = null;

		try {
			held_Plots = (Held_Plots)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = held_Plots.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(17);

		sb.append("{held_id=");
		sb.append(getHeld_id());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", applicationId=");
		sb.append(getApplicationId());
		sb.append(", location=");
		sb.append(getLocation());
		sb.append(", area=");
		sb.append(getArea());
		sb.append(", developed=");
		sb.append(getDeveloped());
		sb.append(", acquisitionMode=");
		sb.append(getAcquisitionMode());
		sb.append(", regParticulars=");
		sb.append(getRegParticulars());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(28);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Held_Plots");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>held_id</column-name><column-value><![CDATA[");
		sb.append(getHeld_id());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>location</column-name><column-value><![CDATA[");
		sb.append(getLocation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>area</column-name><column-value><![CDATA[");
		sb.append(getArea());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>developed</column-name><column-value><![CDATA[");
		sb.append(getDeveloped());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>acquisitionMode</column-name><column-value><![CDATA[");
		sb.append(getAcquisitionMode());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>regParticulars</column-name><column-value><![CDATA[");
		sb.append(getRegParticulars());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _held_id;
	private String _userId;
	private String _applicationId;
	private String _location;
	private String _area;
	private String _developed;
	private String _acquisitionMode;
	private String _regParticulars;
}